package jp.ac.nitech.matlab.najm.client;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;

public class Launcher {

	public static void main(String[] args) {
		//execute each query in the testbed
		/*String s = new String("CMDCODE000000000");
		System.out.println(s.getBytes().length);
		System.exit(0);*/
		int count = 0;
		try{
			BufferedReader reader = 
				new BufferedReader(new InputStreamReader(new FileInputStream("conf/testbed")));
			String query;
			while((query=reader.readLine())!=null && count==0){
				System.out.println("Client "+count+" Excecuting "+query);
				new Client(count, 
						query.substring(0, 3), //cmd
						query.substring(3, 7), //code
						query.substring(7)	 //target
						).start();	
				count++;
			}
		}catch(Exception e){
			
		}
	}

}
